/*
 *  This file is part of WWWPal.
 *
 *  Copyright (C) 2003  Dr. John Punin, Department of Computer Science
 *  Rensselaer Polytechnic Institute
 *
 *  WWWPal is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  WWWPal is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 *  This file is part of WWWPal.
 *
 *  Copyright (C) 2003  Dr. John Punin, Department of Computer Science
 *  Rensselaer Polytechnic Institute
 *
 *  WWWPal is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  WWWPal is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef LOGR_GEN_PAGES_H
#define LOGR_GEN_PAGES_H

#include <sys/stat.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <sys/time.h>
#include <assert.h>
#include <gr_graph_fun.h>

typedef enum _type_page {
    PWEBNODE = 1, PWEBINDEPENDENT
} TypePage;

typedef struct _web_gen_page_node {
    long naccesses;
    long nacc_stat;
    long nacc_dyna;
    long tbytes;
    TypePage tp;
    void *nodeptr;
} WebGenPageStruct;

typedef struct _web_gen_page_node *WebGenPagePtr;

WebGenPagePtr
new_web_gen_page_node(void);

void
delete_web_gen_page_node(WebGenPagePtr gpn);

void
LOGR_set_type_gen_page(WebGenPagePtr gpn,TypePage tp);

TypePage
LOGR_get_type_gen_page(WebGenPagePtr gpn);

void
LOGR_set_info_gen_page(WebGenPagePtr gpn,void *np);

void *
LOGR_get_info_gen_page(WebGenPagePtr gpn);

void
LOGR_set_gen_naccesses(WebGenPagePtr gpn,long num);

void
LOGR_inc_gen_naccesses(WebGenPagePtr gpn);

void
LOGR_add_gen_naccesses(WebGenPagePtr gpn,long hits);

long
LOGR_get_gen_naccesses(WebGenPagePtr gpn);

void
LOGR_set_gen_total_bytes(WebGenPagePtr gpn,long bytes);

void
LOGR_add_gen_total_bytes(WebGenPagePtr gpn,long bytes);

long
LOGR_get_gen_total_bytes(WebGenPagePtr gpn);

long
LOGR_get_gen_nacc_dynamic(WebGenPagePtr gpn);

void
LOGR_inc_gen_nacc_dynamic(WebGenPagePtr gpn);

void
LOGR_add_gen_nacc_dynamic(WebGenPagePtr gpn,long hits);

void
LOGR_set_gen_nacc_dynamic(WebGenPagePtr gpn,long num);

long
LOGR_get_gen_nacc_static(WebGenPagePtr gpn);

void
LOGR_inc_gen_nacc_static(WebGenPagePtr gpn);

void
LOGR_add_gen_nacc_static(WebGenPagePtr gpn,long hits);

void
LOGR_set_gen_nacc_static(WebGenPagePtr gpn,long num);

int
LOGR_is_access_gen_lower(WebGenPagePtr u, WebGenPagePtr v);

int
LOGR_is_access_gen_bigger(WebGenPagePtr u,WebGenPagePtr v);

int
LOGR_is_access_stat_gen_lower(WebGenPagePtr u, WebGenPagePtr v);

int
LOGR_is_access_stat_gen_bigger(WebGenPagePtr u,WebGenPagePtr v);

int
LOGR_is_tot_access_gen_lower(WebGenPagePtr u, WebGenPagePtr v);

int
LOGR_is_tot_access_gen_bigger(WebGenPagePtr u,WebGenPagePtr v);

const char *
LOGR_get_gen_url(WebGenPagePtr gnp);

int
LOGR_get_gen_num(WebGenPagePtr gnp);

long
LOGR_get_gen_sizebytes(WebGenPagePtr gnp);

long
LOGR_get_gen_tot_naccesses(WebGenPagePtr gnp);

const char *
LOGR_get_gen_title(WebGenPagePtr gnp);

const char *
LOGR_get_gen_mime(WebGenPagePtr gnp);

short
LOGR_is_gen_page_independent(WebGenPagePtr spn);

#endif

